var t = require;
var e = module;
var o = exports;
Object.defineProperty(o, "__esModule", {
    value: !0
}),
o.GameLogic = o.AI_WeightLevel = void 0;
var i = t("GlobalUserData"),
n = t("Util"),
a = t("CarConstant"),
r = t("Global"),
s = [[330, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [230, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [140, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [70, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [30, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 10, 0, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 70], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 140], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 230], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 330]],
l = [0, 5, 26, 51, 285, 329, 398, 482, 895, 1033, 1250, 1514, 2810, 3245, 3927, 4751, 8819, 10186, 12325, 14914, 27680];
o.AI_WeightLevel = [[430, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [230, 190, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [40, 190, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [30, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 40, 20, 10, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 90, 70, 70], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 100, 230], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 20, 40, 70, 90, 330], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, 430]];
var c = function() {
    function t() {}
    return t.prototype.getCollideTag = function(t, e) {
        return e < 10 ? Number(t + "0" + e) : Number(t + "" + e)
    },
    t.prototype.getColliderCarTag = function(t) {
        return parseInt((t / 100).toString())
    },
    t.prototype.getColliderWheelTag = function(t) {
        return t % 100
    },
    t.prototype.getColliderWeaponTag = function(t) {
        return t % 100
    },
    t.prototype.getPhysicsTag = function(t, e) {
        return e < 10 ? Number(t + "0" + e) : Number(t + "" + e)
    },
    t.prototype.getPhysicsCarTag = function(t) {
        return parseInt((t / 100).toString())
    },
    t.prototype.getPhysicsBodyTag = function(t) {
        return t % 100
    },
    t.prototype.getHammerDamage = function() {
        return 5
    },
    t.prototype.getSawDamage = function() {
        return 7
    },
    t.prototype.getRocketDamage = function() {
        return 7
    },
    t.prototype.getGuide1CarData = function() {
        var t = [.5],
        e = [1],
        o = [{
            body: {
                id: "body03",
                star: 1
            },
            wheel0: {
                id: "wheel02",
                star: 1
            },
            wheel1: {
                id: "wheel02",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Saw,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        }];
        switch (i.default.nTotalGame) {
            case 0:
                o = [{
                body: {
                    id: "body03",
                    star: 1
                },
                wheel0: {
                    id: "wheel02",
                    star: 1
                },
                wheel1: {
                    id: "wheel02",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Saw,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            }],
            t = [.3],
            e = [.75];
            break;
            case 1:
                o = [{
                body: {
                    id: "body04",
                    star: 1
                },
                wheel0: {
                    id: "wheel01",
                    star: 1
                },
                wheel1: {
                    id: "wheel01",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Rocket,
                    star: 1
                },
                tools: {
                    id: a.Tools_ID.Harpoon,
                    star: 1
                }
            },
            {
                body: {
                    id: "body02",
                    star: 1
                },
                wheel0: {
                    id: "wheel03",
                    star: 1
                },
                wheel1: {
                    id: "wheel03",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Hammer,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            }],
            t = [.75, .5],
            e = [1, 1];
            break;
            case 2:
                o = [{
                body: {
                    id: "body05",
                    star: 1
                },
                wheel0: {
                    id: "wheel01",
                    star: 1
                },
                wheel1: {
                    id: "wheel01",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Rocket,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            },
            {
                body: {
                    id: "body04",
                    star: 1
                },
                wheel0: {
                    id: "wheel03",
                    star: 1
                },
                wheel1: {
                    id: "wheel03",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Hammer,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            }],
            t = [.8, .8],
            e = [1, 1];
            break;
            case 3:
                o = [{
                body: {
                    id: "body03",
                    star: 1
                },
                wheel0: {
                    id: "wheel02",
                    star: 1
                },
                wheel1: {
                    id: "wheel02",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.ElecSaw,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            },
            {
                body: {
                    id: "body05",
                    star: 1
                },
                wheel0: {
                    id: "wheel03",
                    star: 1
                },
                wheel1: {
                    id: "wheel03",
                    star: 1
                },
                weapon0: {
                    id: a.Weapon_ID.Saw,
                    star: 1
                },
                tools: {
                    id: null,
                    star: 1
                }
            }],
            t = [4, 4],
            e = [4, 4];
        }
        return this.getGuideCarData(o, o.length, t, e)
    },
    t.prototype.getGuide2CarData = function(t) {
        var e = [{
            body: {
                id: "body02",
                star: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1
            },
            wheel1: {
                id: "wheel03",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: a.Tools_ID.Thruster,
                star: 1
            }
        }];
        return this.getGuideCarData(e, t, [.5])
    },
    t.prototype.getGuide3CarData = function(t) {
        var e = [{
            body: {
                id: "body01",
                star: 1
            },
            wheel0: {
                id: "wheel04",
                star: 1
            },
            wheel1: {
                id: "wheel03",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        },
        {
            body: {
                id: "body01",
                star: 1
            },
            wheel0: {
                id: "wheel02",
                star: 1
            },
            wheel1: {
                id: "wheel02",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Saw,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        }];
        return this.getGuideCarData(e, t, [.5])
    },
    t.prototype.getGuide4CarData = function(t) {
        var e = [{
            body: {
                id: "body01",
                star: 2,
                coe: 1.5
            },
            wheel0: {
                id: "wheel02",
                star: 2,
                coe: 1.5
            },
            wheel1: {
                id: "wheel02",
                star: 2,
                coe: 1.5
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 2,
                coe: 1.5
            },
            tools: {
                id: null,
                star: 2,
                coe: 1.5
            }
        },
        {
            body: {
                id: "body05",
                star: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1
            },
            wheel1: {
                id: "wheel01",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        },
        {
            body: {
                id: "body04",
                star: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1
            },
            wheel1: {
                id: "wheel01",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        }];
        return this.getGuideCarData(e, t, [.7])
    },
    t.prototype.getGuide5CarData = function(t) {
        var e = [{
            body: {
                id: "body05",
                star: 1,
                coe: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1,
                coe: 1
            },
            wheel1: {
                id: "wheel01",
                star: 1,
                coe: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1,
                coe: 2
            },
            tools: {
                id: null,
                star: 1,
                coe: 1
            }
        },
        {
            body: {
                id: "body01",
                star: 1
            },
            wheel0: {
                id: "wheel02",
                star: 1
            },
            wheel1: {
                id: "wheel02",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        },
        {
            body: {
                id: "body04",
                star: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1
            },
            wheel1: {
                id: "wheel01",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 1
            },
            tools: {
                id: null,
                star: 1
            }
        }];
        return this.getGuideCarData(e, t, [.6])
    },
    t.prototype.getGuide6CarData = function(t) {
        var e = [{
            body: {
                id: "body01",
                star: 2
            },
            wheel0: {
                id: "wheel04",
                star: 2
            },
            wheel1: {
                id: "wheel03",
                star: 2
            },
            weapon0: {
                id: a.Weapon_ID.Hammer,
                star: 2
            },
            tools: {
                id: null,
                star: 2
            }
        },
        {
            body: {
                id: "body04",
                star: 1
            },
            wheel0: {
                id: "wheel01",
                star: 1
            },
            wheel1: {
                id: "wheel01",
                star: 1
            },
            weapon0: {
                id: a.Weapon_ID.Saw,
                star: 1
            },
            tools: {
                id: a.Tools_ID.Thruster,
                star: 1
            }
        },
        {
            body: {
                id: "body05",
                star: 2
            },
            wheel0: {
                id: "wheel02",
                star: 2
            },
            wheel1: {
                id: "wheel02",
                star: 2
            },
            weapon0: {
                id: a.Weapon_ID.Rocket,
                star: 2
            },
            tools: {
                id: a.Tools_ID.Thruster,
                star: 2
            }
        }];
        return this.getGuideCarData(e, t, [1])
    },
    t.prototype.getArenaCarData = function(t, e) {
        void 0 === e && (e = 1);
        for (var o = [], i = 0; i < t; i++) {
            var r = {
                body: {
                    id: a.getBodyIdList()[n.Util.getRandomInt(0, a.getBodyIdList().length)],
                    star: e
                },
                wheel0: {
                    id: a.getWheelIdList()[n.Util.getRandomInt(0, a.getWheelIdList().length)],
                    star: e
                },
                wheel1: {
                    id: a.getWheelIdList()[n.Util.getRandomInt(0, a.getWheelIdList().length)],
                    star: e
                },
                weapon0: {
                    id: a.getWeaponIdList()[n.Util.getRandomInt(0, a.getWeaponIdList().length)],
                    star: e
                },
                tools: {
                    id: a.getToolsIdList()[n.Util.getRandomInt(0, a.getToolsIdList().length)],
                    star: e
                }
            };
            o.push(r)
        }
        return this.getGuideCarData(o, t, [1], [1])
    },
    t.prototype.getGuideCarData = function(t, e, o, i) {
        for (var n = {
            body: [],
            weapon: [],
            wheel: [],
            tools: []
        },
        r = 0; r < e; r++) {
            var s = null,
            l = null,
            c = null,
            d = null,
            h = null;
            r < t.length && (s = this.getOneItemData(11, t[r].body.id, t[r].body.star, a.Basics_Items_Type.body, r, o[r] || o[0], t[r].body.coe, i[r]), l = this.getOneItemData(31, t[r].weapon0.id, t[r].weapon0.star, a.Basics_Items_Type.weapon, r, o[r] || o[0], t[r].weapon0.coe, i[r]), c = this.getOneItemData(21, t[r].wheel0.id, t[r].wheel0.star, a.Basics_Items_Type.wheel, r, o[r] || o[0], t[r].wheel0.coe, i[r]), d = this.getOneItemData(22, t[r].wheel1.id, t[r].wheel1.star, a.Basics_Items_Type.wheel, r, o[r] || o[0], t[r].wheel1.coe, i[r]), h = this.getOneItemData(41, t[r].tools.id, t[r].tools.star, a.Basics_Items_Type.tools, r, o[r] || o[0], t[r].tools.coe, i[r]));
            var p = {
                body: s,
                weapon: [l, 0],
                wheel: [c, d],
                tools: [h, 0]
            };
            n.body.push(p.body),
            n.weapon.push(p.weapon),
            n.wheel.push(p.wheel),
            n.tools.push(p.tools)
        }
        return n
    },
    t.prototype.getGuide4CarDataold = function(t) {
        for (var e = {
            body: [],
            weapon: [],
            wheel: [],
            tools: []
        },
        o = !1, i = 0; i < t; i++) {
            var n = this.getOtherCarItem(11, 1, a.Basics_Items_Type.body, a.Basics_Body_Info),
            r = this.getOtherCarItem(31, 1, a.Basics_Items_Type.weapon, a.Basics_Weapon_Info),
            s = this.getOtherCarItem(21, 1, a.Basics_Items_Type.wheel, a.Basics_Wheel_Info),
            l = this.getOtherCarItem(22, 1, a.Basics_Items_Type.wheel, a.Basics_Wheel_Info),
            c = this.getOtherCarItem(41, 1, a.Basics_Items_Type.tools, a.Basics_Tools_Info);
            c.id == a.Tools_ID.Harpoon && (o = !0),
            o || i != t - 1 || (c.id = a.Tools_ID.Harpoon);
            var d = {
                body: n,
                weapon: [r, 0],
                wheel: [s, l],
                tools: [c, 0]
            };
            e.body.push(d.body),
            e.weapon.push(d.weapon),
            e.wheel.push(d.wheel),
            e.tools.push(d.tools)
        }
        return e
    },
    t.prototype.getOneItemData = function(t, e, o, i, s, l, c, d) {
        if (!e) return 0;
        var h = l || 1,
        p = d || 1;
        c = c || 1;
        var u = null;
        switch (i) {
            case a.Basics_Items_Type.body:
                u = a.getBodyData(e);
            break;
            case a.Basics_Items_Type.wheel:
                u = a.getWheelData(e);
            break;
            case a.Basics_Items_Type.weapon:
                u = a.getWeaponData(e);
            break;
            case a.Basics_Items_Type.tools:
                u = a.getToolsData(e);
        }
        var f = Math.floor(a.GetRandomItemHp(u, o) * p * c),
        m = Math.floor(a.GetRandomItemDamage(u, o) * h * c);
        switch (o) {
            case 3:
                f = n.Util.getCurItemData(s, i, a.DataType.hp) * n.Util.getRandomInt(2, 4),
            m = n.Util.getCurItemData(s, i, a.DataType.damage) * n.Util.getRandomInt(2, 4);
        }
        return {
            uid: t,
            id: u.id,
            type: i,
            hp: f,
            damage: m,
            quality: r.Quality.common,
            elec: a.GetRandomItemElec(u, o),
            star: o
        }
    },
    t.prototype.getRightCarData = function(t, e, o) {
        i.default.nTrophy < 1e3 && (t = 2);
        for (var n = {
            body: [],
            weapon: [],
            wheel: [],
            tools: []
        },
        a = 0; a < t; a++) {
            var r = this.getOneCarData(e, o);
            n.body.push(r.body),
            n.weapon.push(r.weapon),
            n.wheel.push(r.wheel),
            n.tools.push(r.tools)
        }
        return n
    },
    t.prototype.getOneCarData = function(t) {
        t < 0 ? t = 0 : t >= s.length && (t = s.length - 1);
        var e = this.getOtherCarStar(t);
        console.log("总的星星:" + e);
        var o = 5;
        o = 0 == t ? 4 : 5,
        o = n.Util.getRandomInt(o, 6);
        var i = this.getItemStarMax(e, o),
        r = this.getItemStarMin(e, o),
        l = n.Util.getRandomInt(r, i + 1),
        c = this.getOtherCarItem(11, l, a.Basics_Items_Type.body, a.Basics_Body_Info); --o < 0 && (o = 0);
        var d = this.getItemStarMax(e - l, o),
        h = this.getItemStarMin(e - l, o),
        p = n.Util.getRandomInt(h, d + 1),
        u = this.getOtherCarItem(31, p, a.Basics_Items_Type.weapon, a.Basics_Weapon_Info); --o < 0 && (o = 0);
        var f = this.getItemStarMax(e - l - p, o),
        m = this.getItemStarMin(e - l - p, o),
        _ = n.Util.getRandomInt(m, f + 1),
        y = this.getOtherCarItem(21, _, a.Basics_Items_Type.wheel, a.Basics_Wheel_Info); --o < 0 && (o = 0);
        var g = this.getItemStarMax(e - l - p - _, o),
        v = this.getItemStarMin(e - l - p - _, o),
        C = n.Util.getRandomInt(v, g + 1),
        b = this.getOtherCarItem(22, C, a.Basics_Items_Type.wheel, a.Basics_Wheel_Info); --o < 0 && (o = 0);
        var w = this.getItemStarMax(e - l - p - _ - C, o),
        S = this.getItemStarMax(e - l - p - _ - C, o),
        I = n.Util.getRandomInt(S, w + 1),
        B = this.getOtherCarItem(41, I, a.Basics_Items_Type.tools, a.Basics_Tools_Info);
        return {
            body: c,
            weapon: [u, 0],
            wheel: 0 == n.Util.getRandomInt(0, 2) ? [y, b] : [b, y],
            tools: [B, 0]
        }
    },
    t.prototype.setAiDifficulty = function(t) {
        var e = this.getAiLevel();
        return t + Math.ceil(t * (l[e] / 100))
    },
    t.prototype.getAiLevel = function() {
        for (var t = this.getTrophyLevel(), e = o.AI_WeightLevel[t], i = 0, a = 0; a < e.length; a++) i += e[a];
        for (var r = n.Util.getRandomInt(1, i), s = 0, l = 0; l < e.length; l++) if (r <= (s += e[l])) return l
    },
    t.prototype.getTrophyLevel = function() {
        var t = i.default.nTrophy;
        return t >= 0 && t <= 70 ? 0 : t >= 71 && t <= 160 ? 1 : t >= 161 && t <= 280 ? 2 : t >= 281 && t <= 400 ? 3 : t >= 401 && t <= 600 ? 4 : t >= 601 && t <= 800 ? 5 : t >= 801 && t <= 1e3 ? 6 : t >= 1001 && t <= 1400 ? 7 : t >= 1401 && t <= 1800 ? 8 : t >= 1801 && t <= 2200 ? 9 : t >= 2201 && t <= 2600 ? 10 : t >= 2601 && t <= 3e3 ? 11 : t >= 3001 && t <= 99999999 ? 12 : void 0
    },
    t.prototype.getOtherCarStar = function(t) {
        for (var e = s[t], o = 0, i = 0; i < e.length; i++) o += e[i];
        var a = n.Util.getRandomInt(0, o),
        r = 0;
        for (i = 0; i < e.length; i++) if (a <= (r += e[i])) return 4 + i
    },
    t.prototype.getItemStarMax = function(t, e) {
        if (t <= 0) return 0;
        var o = t - e + 1;
        return o > a.Item_Star_Max && (o = a.Item_Star_Max),
        o
    },
    t.prototype.getItemStarMin = function(t, e) {
        if (0 == e) return 0;
        for (var o = 0; o < a.Item_Star_Max; o++) if (o * e >= t) return o
    },
    t.prototype.getOtherCarItem = function(t, e, o, i) {
        if (e <= 0) return cc.log("other car wheel data is null !!"),
        null;
        var s = i,
        l = n.Util.getRandomInt(0, i.length);
        e = e || 1;
        var c = r.Quality.common;
        if (o == a.Basics_Items_Type.body && n.Util.probability(.25) && (c = r.Quality.epic), o == a.Basics_Items_Type.weapon) {
            var d;
            l = (d = n.Util.probability(.35) ? n.Util.probability(.08) ? i.filter(function(t) {
                return t.quality == r.Quality.Legendary
            }) : i.filter(function(t) {
                return t.quality == r.Quality.epic
            }) : i.filter(function(t) {
                return t.quality == r.Quality.common
            })).length > 0 ? n.Util.getRandomInt(0, d.length) : 0,
            s = d
        }
        return {
            uid: t,
            id: s[l].id,
            type: o,
            hp: this.setAiDifficulty(a.GetRandomItemHp(s[l], e)),
            damage: this.setAiDifficulty(a.GetRandomItemDamage(s[l], e)),
            elec: a.GetRandomItemElec(s[l], e),
            quality: c,
            star: e
        }
    },
    t
} ();
o.GameLogic = c